Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deny creating tables with column comment if unsupported #12574

Merged

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented May 27, 2022

Description

Deny creating tables with column comment if unsupported

Documentation

(x) No documentation is needed.

Release notes

(x) Release notes entries required with the following suggested text:

# BigQuery, Cassandra, Delta Lake, Kudu, MariaDB, Memory, MySQL, Oracle, Phoenix, PostgreSQL, Raptor, Redshift, SingleStore, SQL Server, 
* Deny `CREATE TABLE` statement if column comment is specified. ({issue}`12574`)

@ebyhr ebyhr added the no-release-notes This pull request does not require release notes entry label May 27, 2022
@cla-bot cla-bot bot added the cla-signed label May 27, 2022
@ebyhr ebyhr marked this pull request as ready for review May 27, 2022 11:37
@findepi
Copy link
Member

findepi commented May 27, 2022

added the no-release-notes label

i think this should be in release notes.
we're changing user-facing aspect of a bunch of connectors.

@ebyhr ebyhr force-pushed the ebi/test-create-table-with-column-comment branch from 83ea6de to 2f12b2a Compare May 27, 2022 12:07
@ebyhr ebyhr removed the no-release-notes This pull request does not require release notes entry label May 27, 2022
@ebyhr ebyhr merged commit 4911312 into trinodb:master May 28, 2022
@ebyhr ebyhr deleted the ebi/test-create-table-with-column-comment branch May 28, 2022 00:02
@ebyhr ebyhr mentioned this pull request May 28, 2022
@github-actions github-actions bot added this to the 383 milestone May 28, 2022
@@ -549,6 +549,9 @@ protected String createTableSql(RemoteTableName remoteTableName, List<String> co

protected String getColumnDefinitionSql(ConnectorSession session, ColumnMetadata column, String columnName)
{
if (column.getComment() != null) {
throw new TrinoException(NOT_SUPPORTED, "This connector does not support creating tables with column comment");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebyhr getColumnDefinitionSql method is used for both 'create table' and 'add column' flows
image
So the exception message during 'add column' flow is not correct.
Could you please help to tackle that situation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let me fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants